// import CateLists from "@/pages/CateLists";
// import DashBoard from "@/pages/DashBoard";
// import ItemAdd from "@/pages/ItemAdd";
// import ItemLists from "@/pages/ItemLists";
// import ItemUpdate from "@/pages/ItemUpdate";
// import Settings from "@/pages/Settings";
// import UserInfo from "@/pages/UserInfo";

// 路由懒加载   app中设置suspense
import { lazy } from "react"
const CateLists = lazy(()=>import("@/pages/CateLists"))
const DashBoard = lazy(()=>import("@/pages/DashBoard"))
const ItemAdd = lazy(()=>import("@/pages/ItemAdd"))
const ItemLists = lazy(()=>import("@/pages/ItemLists"))
const ItemUpdate = lazy(()=>import("@/pages/ItemUpdate"))
const Settings = lazy(()=>import("@/pages/Settings"))
const UserInfo = lazy(()=>import("@/pages/UserInfo"))



const routes = [
    {
        path: '/dashBoard',
        component: DashBoard,
        roles: '*'
    },
    {
        path: '/cateLists',
        component: CateLists,
        roles: ['superAdmin', 'admin', 'commonPeople']
    },
    {
        path: '/itemLists',
        component: ItemLists,
        roles: ['superAdmin', 'admin', 'commonPeople']
    },
    {
        path: '/itemAdd',
        component: ItemAdd,
        roles: ['superAdmin', 'admin', 'commonPeople']
    },
    {
        path: '/itemUpdate',
        component: ItemUpdate,
        roles: ['superAdmin', 'admin', 'commonPeople']
    },  
    // 设置页 无admin权限
    {
        path: '/settings',
        component: Settings,
        roles: ['superAdmin', 'commonPeople']
    },
    {
        path: '/userInfo',
        component: UserInfo,
        roles: ['superAdmin', 'admin', 'commonPeople']
    }
]

export default routes